package com.naiterui.ehp.bs.cms.modules.pharmacy.feign;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import com.naiterui.ehp.bp.support.config.FeignConfiguration;
import com.naiterui.ehp.bp.support.exception.BusinessException;

@RequestMapping("/inner/cms/warehouse")
@FeignClient(name = "warehouse", url = "${ehp.domain.b2c}", configuration = FeignConfiguration.class)
public interface WarehouseFeignClient {

    /**
     * 保存更新
     */
    @PostMapping
    Long saveOrUpdate(@RequestBody String json) throws BusinessException;

    /**
     * 更新状态
     */
    @PutMapping("/{id}/{status}")
    void updateStatus(@PathVariable("id") Long id, @PathVariable("status") Integer status) throws BusinessException;
}
